<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">
<h:head>
<ui:include src="../templates/subhead.xhtml" />
<script type="text/javascript">
$(function() {
 var dialog = $( ".rejectFilingPageRow" ).dialog({
	autoOpen: false,
	height: 350,
	width: 450,
	modal: true
});
 
 $(".rejectButton" ).on( "click", function() {
	 dialog.dialog( "open" );
 });
 
});
 </script>
</h:head>
<h:body styleClass="iframebody">

<f:loadBundle basename="us.gaaoc.framework.webapp.util.userMessage"	var="bundle" />	
<t:div id="search" styleClass="search">
<table style="width:100%">
	<tr>
	<h:form id="uploadForm" method="POST">
		<td>
				Case Status 
		</td>
   		<td>
			<h:selectOneMenu id="caseStatus" size="1" value="#{attFilingsTablePage.caseStatus}" binding="#{attFilingsTablePage.caseStatusInput}" title="#{bundle.caseStatusInputText}">
				<f:selectItems id="selectItem" value="#{attFilingsTablePage.caseStatusItems}"  />
			</h:selectOneMenu>
		</td>
		<td>
			<label for="OCSSNumber">Ocss Number </label>
		</td>
		<td>
			<h:inputText id="OCSSNumber" value="#{attFilingsTablePage.externalCaseRecordNumber}" title="#{bundle.oCSSNumberInputText}"/> 
		</td>
		<td>
			<label for="docketId">Civil Action Number </label>
		</td>
		<td>
			<h:inputText id="docketId"	value="#{attFilingsTablePage.docketId}" title="#{bundle.civilActionNumberInputText}"/> 
		</td>
		<td>
		<h:commandButton for="CivilActionNumber" value="View Case Filing" title="#{bundle.civilActionNumberButton}">
			  <f:ajax event="click" execute="@form" render="dataform"/>
		</h:commandButton>
							
		</td>
	
	</h:form> 
	</tr>
	</table>
	
</t:div>

<h:form id="dataform">

	<h:panelGrid columns="1" styleClass="outerTable"
		columnClasses="standardTable_ColumnCentered">
		<h:column>
			<center>
			<t:dataTable
				rowClasses="${attFilingsTablePage.rowClasses}"
				renderedIfEmpty="false" id="attorneyTable"
				value="#{attFilingsTablePage.data}" var="caseRecord"
				styleClass="iCubed" width="100%" rows="10" preserveDataModel="true" sortable="true" rowIndexVar="rowNumber" preserveSort="false"
				binding="#{attFilingsTablePage.dataTable}" varDetailToggler="detailToggler" ajaxRowRender="true">
				<h:column>
					<f:facet name="header">
						<h:outputText id="content" value="Case Details" />
					</f:facet>
					<t:div id="panel">
					 <t:commandLink  action="#{detailToggler.toggleDetail}" styleClass="showhide ui-icon ui-icon-circle-arrow-w">
								 		<h:outputText value="show" styleClass="ui-icon ui-icon-circle-arrow-w"/>			             
			              <f:ajax render="detailStampRow" onevent="myJsFunction"  listener="#{attCaseDetailsPage.onCaseUuidChange(caseRecord.uuid)}"/><!-- panel detailStampRow -->
			          </t:commandLink>						          							
			       </t:div>	
				</h:column>
				
				<h:column>
					<f:facet name="header">
						<h:outputText value="OCSS Number" />
					</f:facet>
					<h:outputText value="#{caseRecord.filingNumber}"
						rendered="${caseRecord.valid}" />
				</h:column>

				<h:column>
					<f:facet name="header">
						<h:outputText value="Civil Action #" />
					</f:facet>
					<h:outputText value="#{caseRecord.caseTrackingId}"
						rendered="${caseRecord.valid}" />
				</h:column> 
				
				<h:column>
					<f:facet name="header">
						<h:commandLink action="${attFilingsTablePage.sortByInitiatedDate}" >
							<h:outputText value="Initiated Date" />
						</h:commandLink>
					</f:facet>

					<h:outputText value="#{caseRecord.instantiationDateTime}"
						rendered="${caseRecord.valid}">
						<f:convertDateTime dateStyle="medium" timeZone="America/New_York"
							type="date" />
					</h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText id="defendantFirstName" value="Defendant First Name" />
					</f:facet>

					<h:outputText value="#{caseRecord.defendantFirstName}"
						rendered="${caseRecord.valid}" />
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText id="defendantLastName" value="Defendant Last Name" />
					</f:facet>

					<h:outputText value="#{caseRecord.defendantLastName}"
						rendered="${caseRecord.valid}" />
				</h:column>


				<h:column>
					<f:facet name="header">
						<h:outputText id="caseStatus" value="Case Status" />
					</f:facet>
					<h:outputText value="#{caseRecord.status.description}" rendered="${caseRecord.valid}"  />

				</h:column>
				<!-- <h:column>
					<f:facet name="header">
						<h:outputText id="lastEvent" value="Last Event" />
					</f:facet>
					<h:commandLink id="filingIDLink" value="Event Log" rendered="${caseRecord.valid}" 
						action="#{attFilingsTablePage.gotoHistoryPage}" target="_parent">
						<f:param name="caseUuid" value="#{caseRecord.uuid}" />
					</h:commandLink>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:commandLink action="${attFilingsTablePage.sortByMostRecent}">
							<h:outputText id="lastEventTime" value="Last Event Time" />
						</h:commandLink>
					</f:facet>
					<h:outputText value="#{caseRecord.lastEventTime}" rendered="${caseRecord.valid}" >
						<f:convertDateTime dateStyle="medium" timeZone="America/New_York"
							type="date" />
					</h:outputText>
				</h:column> -->
				<h:column headerClass="actionhead">
					<f:facet name="header">
						<h:outputText id="filingID" value="Case Actions" />
					</f:facet>					
			        <h:commandLink title="#{bundle.sendToClerk}" onclick="return confirm('Are you sure you want to send the case to the clerk ?');">
							<h:outputText value="show" styleClass="ui-icon ui-icon-mail-closed"/>
							<f:ajax render="dataform" listener="#{attCaseDetailsPage.sendToCourt(caseRecord.uuid)}"/><!-- panel detailStampRow -->	
						</h:commandLink>
						<h:commandLink rendered="#{table.status == 7}" onclick="return confirm('Are you sure you want to delete the case ?');">
						<h:outputText value="show" styleClass="ui-icon ui-icon-trash"/>
						<f:ajax render="dataform" listener="#{attFilingsTablePage.clearCase(caseRecord.uuid)}"/><!-- panel detailStampRow -->									
					</h:commandLink>
					<h:commandLink styleClass="rejectButton" title="#{bundle.rejectToAgent}">
						<h:outputText value="show" styleClass="ui-icon ui-icon-closethick"/>
						<f:ajax listener="#{attCaseDetailsPage.onCaseUuidChange(caseRecord.uuid)}"/><!-- panel detailStampRow -->									
					</h:commandLink>		
				</h:column>				
				 <f:facet name="detailStamp">							
					<ui:include src="childEnforcement/childEnforcementCaseDetailsPage.xhtml" />
			    </f:facet>
				
				</t:dataTable></center>
		</h:column>

		<h:column>
			<div align="center"><t:dataScroller fastStep="5"
				styleClass="scrollerTable" pageCountVar="pageCount"
				pageIndexVar="pageIndex" paginator="true" paginatorMaxPages="10"
				paginatorTableClass="paginator"
				paginatorActiveColumnClass="active" immediate="false"
				for="attorneyTable">
				<f:facet name="first">
					<h:outputText value="first" styleClass="ui-icon ui-icon-seek-first"/>
					<!-- <t:graphicImage url="/images/arrow-first.gif" border="1"
						styleClass="objectList_GraphicImage" /> -->
				</f:facet>
				<f:facet name="last">
					<h:outputText value="last" styleClass="ui-icon ui-icon-seek-end"/>
					<!-- <t:graphicImage url="/images/arrow-last.gif" border="1"
						styleClass="objectList_GraphicImage" /> -->
				</f:facet>
				<f:facet name="previous">
					<h:outputText value="previous" styleClass="ui-icon ui-icon-seek-first previous"/>
					<!-- <t:graphicImage url="/images/arrow-previous.gif" border="1"
						styleClass="objectList_GraphicImage" /> -->
				</f:facet>
				<f:facet name="next">
					<h:outputText value="next" styleClass="ui-icon ui-icon-seek-end next"/>
					<!-- <t:graphicImage url="/images/arrow-next.gif" border="1"
						styleClass="objectList_GraphicImage" /> -->
				</f:facet>
				<f:facet name="fastforward">
					<h:outputText value="fastforward" styleClass="ui-icon ui-icon-seek-next"/>
					<!-- <t:graphicImage url="/images/arrow-ff.gif" border="1"
						styleClass="objectList_GraphicImage" /> -->
				</f:facet>
				<f:facet name="fastrewind">
					<h:outputText value="fastrewind" styleClass="ui-icon ui-icon-seek-prev"/>
					<!-- <t:graphicImage url="/images/arrow-fr.gif" border="1"
						styleClass="objectList_GraphicImage" /> -->
				</f:facet>
			</t:dataScroller></div>
		</h:column>
	</h:panelGrid>
</h:form>
<t:div id="rejectFilingPageRow" styleClass="rejectFilingPageRow">
  <ui:include src="rejectFilingPage.xhtml" />
</t:div>
</h:body>
</html>